package ch.zhaw.skuh.turing.main;

import ch.zhaw.skuh.turing.controller.Controller;
import ch.zhaw.skuh.turing.controller.Controller.MODE;

public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		int index = 0;
		MODE mode =MODE.GUI;
		String file =null;
		String input = null;
		
		if(args.length>0){
			for (int i = 0; i < args.length; i++) {
				//maschine index
				if (args[i].compareToIgnoreCase("-index")==0) {
					index=Integer.parseInt(args[++i]);
				}
				//mode
				if (args[i].compareToIgnoreCase("-mode")==0) {
					for (MODE m : MODE.values()) {
						if(args[i+1].equalsIgnoreCase(m.toString())){
							mode = m;
							break;
						}
					}
					i++;
				}
				//file
				if (args[i].compareToIgnoreCase("-file")==0) {
					file = args[++i];
				}

				//input
				if (args[i].compareToIgnoreCase("-input")==0) {
					input = args[++i];
				}
			}

			System.out.println(index);
			System.out.println(mode);
			System.out.println(file);
		}
		new Controller(mode, index, file, input);
		
	}

}
